﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Assignment2.States;
using Assignment2.Conditions;

namespace Assignment2.Transitions
{
    class SleepingToWaitingTransition : Transition
    {
        public SleepingToWaitingTransition(ref Integer boringValue, ref Integer hungryValue, ref Integer toyValue, ref Integer foodValue, ref Integer idleTime)
            : base()
        {
            Condition userInteracted = new IsLesserThanOrEqualCondition(idleTime, new Integer(0));
            Condition closeToHungry = new IsGreaterThanOrEqualCondition(hungryValue, new Integer(1080));
            Condition closeToBoring = new IsGreaterThanOrEqualCondition(boringValue, new Integer(1080));
            condition = new OrCondition(new OrCondition(closeToBoring, closeToHungry),userInteracted );
        }

        public override void updateMember()
        {
            targetState = StateAndTransitionPool.Waiting;
        }
    }
}
